#include "yuvspec.h"



void YUVSpec::imageSizeChange()
{
    imageSize = av_image_get_buffer_size(format,width,height,1);
}

YUVSpec::YUVSpec(int width, int height,int fps, AVPixelFormat format):width(width),height(height),fps(fps),format(format)
{
    // 计算imageSize
    imageSizeChange();
}

int YUVSpec::getImageSize() const
{

    return imageSize;
}

int YUVSpec::getWidth() const
{

    return width;
}

int YUVSpec::getHeight() const
{

    return height;
}

AVPixelFormat YUVSpec::getFormat() const
{

    return format;
}

int YUVSpec::getFps() const
{

    return fps;
}

void YUVSpec::setWidth(int width)
{

    this->width = width;
    imageSizeChange();
}

void YUVSpec::setHeight(int height)
{
    this->height = height;
    imageSizeChange();
}

void YUVSpec::setFps(int fps)
{

    this->fps = fps;
}

void YUVSpec::setFormat(AVPixelFormat format)
{
    this->format = format;
    imageSizeChange();
}

